package br.edu.fanor.esfinge.business.impl;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.EJB;
import javax.ejb.Stateless;

import br.edu.fanor.esfinge.business.AmigoSession;
import br.edu.fanor.esfinge.dao.AmigoDAO;
import br.edu.fanor.esfinge.entity.Amigo;


@Stateless(mappedName="ejb/amigoSession")
public class AmigoSessionImp implements AmigoSession{

	@EJB
	private AmigoDAO amigoDAO;
	
	@Override
	public void inserir(Amigo amigo) {
		amigoDAO.inserir(amigo);		
	}
	
	@PostConstruct
	public void postConstruct() {
		System.out.println("Criou o EJB");
	}
		
	@PreDestroy
	public void preDestroy(){
		System.out.println("Destruiu o EJB");
	}	

}
